using System;
using CustomerContactSystem.Core.Infrastructure.Domain;

namespace CustomerContactSystem.Core.Model {
    public class EnquiryDeletion : Entity {
        public virtual DateTime DateOfDeletion { get; set; }
        public virtual string ReasonForDeletion { get; set; }
        public virtual int DuplicateOfEnquiryId { get; set; }

        protected override void Validate() {
            if (DateOfDeletion == DateTime.MinValue) {
                AddBrokenRule(new BusinessRule("DateOfDeletion", "Date of deletion is required!"));
            }

            if (string.IsNullOrEmpty(ReasonForDeletion)) {
                AddBrokenRule(new BusinessRule("ReasonForDeletion", "Reason for deletion is required!"));
            }
        }
    }
}